<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <!-- 最小时间差 -->
    <script>
      let startTime = '23:59'
      let endTime = '00:00'
      function timeDifference(startTime, endTime) {
        let start1 = startTime.split(':')
        let startAll = parseInt(start1[0] * 60) + parseInt(start1[1])
        let end1 = endTime.split(':')
        let endAll = parseInt(end1[0] * 60) + parseInt(end1[1])
        console.log(endAll - startAll)
      }
      timeDifference(startTime, endTime)
    </script>
  </body>
</html>
